<template>
  <div>
    <h3>login</h3>
    <button @click="goIndex">跳转到index</button>
  </div>
</template>

<script>
import { useRoute,useRouter } from 'vue-router';
export default {
    setup(props) {
        //获取路由参数
        let route = useRoute()
        let router =useRouter()
        console.log(route.query);
        console.log(router);

        //定义跳转到index方法
        function goIndex(){
            router.push('/index')
        }
        return {
            goIndex
        }
    }
}
</script>

<style>

</style>